import { ENEMY_TYPE_PROBABILITY } from '../utils/constants.js'
import SmallEnemy from './SmallEnemy.js'
import MediumEnemy from './MediumEnemy.js'
import LargeEnemy from './LargeEnemy.js'

// 敌机工厂类
export default class EnemyFactory {
  // 敌机生成概率
  static TYPE_PROBABILITY = ENEMY_TYPE_PROBABILITY

  // 创建敌机
  static createEnemy(type) {
    switch (type) {
      case 'small':
        return new SmallEnemy()
      case 'medium':
        return new MediumEnemy()
      case 'large':
        return new LargeEnemy()
      default:
        return new SmallEnemy()
    }
  }
}
